package com.zzxx.exam.ui;

import com.zzxx.exam.entity.EntityContext;
import com.zzxx.exam.service.ExamServiceImpl;
import com.zzxx.exam.util.Config;

public class Main {
    public static void main(String[] args) {
        //所有的对象
        WelcomeWindow welcomeWindow = new WelcomeWindow();
        LoginFrame loginFrame = new LoginFrame();
        MenuFrame menuFrame = new MenuFrame();
        ExamFrame examFrame = new ExamFrame();
        MsgFrame msgFrame = new MsgFrame();
        ExamServiceImpl examService = new ExamServiceImpl();
        Config config = new Config("config.properties");
        EntityContext entityContext = new EntityContext(config);
        ClientContext clientContext = new ClientContext();


        //所有的依赖
        loginFrame.setClientContext(clientContext);
        menuFrame.setClientContext(clientContext);
        examService.setEntityContext(entityContext);
        examFrame.setClientContext(clientContext);
        clientContext.setWelcomeWindow(welcomeWindow);
        clientContext.setLoginFrame(loginFrame);
        clientContext.setExamService(examService);
        clientContext.setMenuFrame(menuFrame);
        clientContext.setEntityContext(entityContext);
        clientContext.setExamFrame(examFrame);
        clientContext.setMsgFrame(msgFrame);
        msgFrame.setClientContext(clientContext);
        examService.setEntityContext(entityContext);
        clientContext.show();


    }
}
